local gamelib = require "club.threecard.gamelib"
local game = require "club.threecard.blackjack"

local M = {
    routes = {
        -- 游戏主入口
        {
            path = "/club.threecard.blackjack/entrance",
            components = {
                background = function() 
                    return require("club.threecard.casinolib.ui.backgrounds.Bar")
                end,
                default = function()
                    return require("club.threecard.casinolib.ui.gamelobby.GameLobbyUI")
                end,
            }
        },

        -- 游戏内界面
        {
            path = "/club.threecard.blackjack/ingame",
            components = 
            {
                background = function() return game.require "ui.background.ingame_bg"  end,
                default = function()
                    return game.require "ui.ingame.game_ui"
                end
            }
        },

        -- 游戏帮助弹窗
        {
            path = "/club.threecard.blackjack/manual",
            redirect = "/club.threecard.blackjack/manual/page1",
            components = 
            {
                popup = function()
                    return gamelib.require("UI.Manual.ManualUI")
                end
            },
            children = {
                {
                    path = "page1",
                    meta = {
                        tab_name = "manual:title1",
                        res = "club.threecard.gamelib/ui/manual.b:ManualTabHeader",
                        page_text = "manual:page1"
                    },
                    component = function()
                        return gamelib.require("UI.Manual.ManualPage")
                    end
                },
                {
                    path = "page2",
                    meta = {
                        tab_name = "manual:title2",
                        res = "club.threecard.gamelib/ui/manual.b:ManualTabHeader",
                        page_text = "manual:page2"
                    },
                    component = function()
                        return gamelib.require("UI.Manual.ManualPage")
                    end
                },
            }
        }
    }
}

return M
